<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;

use cmf\controller\HomeBaseController;
use app\portal\service\PostService;
use think\Db;

class PageController extends HomeBaseController
{
    public function index()
    {
        $banner=Db::name("slide_item")->where("slide_id",2)->where('status',1)->order('list_order asc')->limit(0,3)->select();
        foreach ($banner as $k=>$v){
            $img="img".$k;
            $this->assign("{$img}",$v);
        }
       // print_r($banner);exit;
        $article1=Db::name("portal_post")->where("post_type",2)->where("post_status",1)->where("post_title","企业介绍")->find();
        $article2=Db::name("portal_post")->where("post_type",2)->where("post_status",1)->where("post_title","企业文化")->find();
        $article3=Db::name("portal_post")->where("post_type",2)->where("post_status",1)->where("post_title","企业形象")->find();
        $article4=Db::name("portal_post")->where("post_type",2)->where("post_status",1)->where("post_title","组织架构")->find();
        $article1['post_content']=htmlspecialchars_decode($article1['post_content']);
        $article2['post_content']=htmlspecialchars_decode($article2['post_content']);
        $article3['post_content']=htmlspecialchars_decode($article3['post_content']);
        $article4['post_content']=htmlspecialchars_decode($article4['post_content']);
        $this->assign("article1",$article1);
        $this->assign("article2",$article2);
        $this->assign("article3",$article3);
        $this->assign("article4",$article4);
        return $this->fetch(":page");
    }

}
